package com.hunan.api.catv.action.mall;

import com.hunan.api.catv.action.BaseAction;
import com.hunan.api.catv.annotation.MemberAuth;
import com.hunan.api.catv.common.Api;
import com.hunan.api.catv.entity.Result;
import com.hunan.api.catv.service.biz.mall.YouzanMallBiz;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpServletRequest;

@RestController
@RequestMapping(Api.mall_youzan)
public class YouzanMallAction extends BaseAction {

    @Autowired
    private YouzanMallBiz youzanMallBiz;

    @MemberAuth
    @GetMapping("/login")
    public Result login(HttpServletRequest request) {
        return buildResult(youzanMallBiz.login(getMemberId(request)));
    }

    @MemberAuth
    @GetMapping("/logout")
    public Result logout(HttpServletRequest request) {
        return buildResult(youzanMallBiz.logout(getMemberId(request)));
    }

}
